<template>
  <div class="pages">
    <div class="inPages">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="1"
        :page-sizes="[10]"
        :page-size="10"
        layout="total, sizes, prev, pager, next, jumper"
        :total="item.totalCount"
        background
        prev-text="上一页"
        next-text="下一页"
      ></el-pagination>
    </div>
  </div>
</template>



<script>
import { api } from "../pages/api";
export default {
  // 子组件传值给父组件
  props: {
    item: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      arg: {},
    };
  },
  // mounted() {
  //   console.log(item);
  // },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(page_number) {
      this.$emit("pageNumber", page_number); // 子组件传给父组件  返回页码
    },
  },
};
</script>


<style lang="scss">
.pages {
  width: 100%;
  height: 70px;
  line-height: 70px;
  text-align: right;
  .inPages {
    margin-top: 40px;
    height: 30px;
    margin-right: 20px;
  }
}
</style>